# Contributor: Bart Ribbers <bribbers@disroot.org>

# The group tag is just to easily find this APKBUILD by some scripts for automation
# group=kde-applications
maintainer="team/kde <bribbers@disroot.org>"
pkgname=kmime
pkgver=24.08.2
pkgrel=0
pkgdesc="Library for handling mail messages and newsgroup articles"
arch="all"
url="https://community.kde.org/KDE_PIM"
license="LGPL-2.0-or-later"
depends_dev="
	kcodecs-dev
	ki18n-dev
	qt6-qtbase-dev
	"
makedepends="$depends_dev
	doxygen
	extra-cmake-modules
	graphviz
	qt6-qttools-dev
	samurai
	"
subpackages="$pkgname-dev $pkgname-doc $pkgname-lang"
_repo_url="https://invent.kde.org/pim/kmime.git"
source="https://download.kde.org/stable/release-service/$pkgver/src/kmime-$pkgver.tar.xz"

build() {
	cmake -B build -G Ninja \
		-DCMAKE_BUILD_TYPE=RelWithDebInfo \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DBUILD_QCH=ON
	cmake --build build
}

check() {
	ctest --test-dir build --output-on-failure -E "kmime-(rfc2231|dateformatter|header|message)test"
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

sha512sums="
573ac4a41e8cc732b8759acab4d685a11d2a2c87c72d315658c079f0429d5f22ee86a5b2089b26c8fa2cf67e56a3a515a00dc894373a03f72e3e1c36b0436f4d  kmime-24.08.2.tar.xz
"
